#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QMenuBar *menubar = new QMenuBar(this);
    this->setMenuBar(menubar);

    QMenu *menu1 = new QMenu("文件(&F)");
    QMenu *menu2 = new QMenu("编辑(&C)");
    menubar->addMenu(menu1);
    menubar->addMenu(menu2);

    QAction *action1 = new QAction("新建");
    QAction *action2 = new QAction("保存");

    menu1->addAction(action1);
    menu1->addAction(action2);


}

MainWindow::~MainWindow()
{
    delete ui;
}

